// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 修改部门 PUT /api/system/dept */
export async function departmentEditUsingPUT(body: API.SysDept, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/dept', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增部门 POST /api/system/dept */
export async function departmentAddUsingPOST(body: API.SysDept, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/dept', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据部门编号获取详细信息 GET /api/system/dept/${param0} */
export async function departmentGetInfoUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.departmentGetInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  const { deptId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/dept/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 删除部门 DELETE /api/system/dept/${param0} */
export async function departmentRemoveUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.departmentRemoveUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { deptId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/dept/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取部门列表 GET /api/system/dept/list */
export async function departmentListUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.departmentListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/dept/list', {
    method: 'GET',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 查询部门列表（排除节点） GET /api/system/dept/list/exclude/${param0} */
export async function departmentExcludeChildUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.departmentExcludeChildUsingGETParams,
  options?: { [key: string]: any },
) {
  const { deptId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/dept/list/exclude/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取树结构部门列表 GET /api/system/dept/tree */
export async function departmentTreeUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.departmentTreeUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/dept/tree', {
    method: 'GET',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}
